import Life from './components/Life'
import React, { Component } from 'react';
class App extends Component {
  constructor(props) {
    super(props);
  }
  state = { flag:true }
  render() { 
    return ( <div>
      <button onClick={()=>this.setState({flag:!this.state.flag})}>切换</button>
      {this.state.flag&&<Life></Life>}
   </div> );
  }
}
 
 

export default App;